package com.lagou.sale.controller;

import com.lagou.sale.pojo.CreateOrderResult;
import com.lagou.sale.service.BuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BuyController {
    @Autowired
    private BuyService buyService;

    @PostMapping("/create/{id}")
    public CreateOrderResult createOrder(@PathVariable("id") int id) {
        return buyService.createOrder(id);
    }
}
